#include <iostream>
#include <algorithm>
#include <string>

template <class T>
T abs(T x) { return x < 0 ? -x : x; }

int main()
{
	std::string a, b;
	std::cin >> a >> b;
	std::reverse(a.begin(), a.end());
	std::reverse(b.begin(), b.end());
	int d = abs((int)a.size() - (int)b.size());
	if (a.size() < b.size())
		for (int i = 0; i < d; i++) a += '0';
	else
		for (int i = 0; i < d; i++) b += '0';
	int la = a.size();
	int lb = b.size();
	std::string s(std::max(la, lb), '0');
	for (int i = 1; i < la && i < lb; i += 2) {
		int t = b[i] - a[i];
		if (t < 0) t += 10;
		s[i] = t + '0';
	}
	for (int i = 0; i < la && i < lb; i += 2) {
		int t = (b[i] + a[i] - '0' - '0') % 13;
		if (t == 10) s[i] = 'J';
		else if (t == 11) s[i] = 'Q';
		else if (t == 12) s[i] = 'K';
		else s[i] = t + '0';
	}
	std::reverse(s.begin(), s.end());
	std::cout << s << '\n';
}

